--TEST--
bool MySQLndUhConnection::changeUser(resource $res, string $user, string $passwd, string $db, bool $silent)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
	require_once('config.inc');

	class proxy extends MySQLndUhConnection {
		public function changeUser($res, $user, $passwd, $db, $silent) {
			printf("%s(%s)\n", __METHOD__, var_export(func_get_args(), true));
			var_dump($ret = parent::changeUser($res, $user, $passwd, $db, $silent));
			return $ret;
		}
	}

	class proxy2 extends MySQLndUhConnection {
		public function changeUser($res, $user, $passwd, $db, $silent) {
			return false;
		}
	}

	class proxy3 extends MySQLndUhConnection {
		public function changeUser($res, $user, $passwd, $db, $silent) {
			$ret = array();
			return $ret;
		}
	}

	class proxy4 extends MySQLndUhConnection {
		public function changeUser($res, $user, $passwd, $db, $silent) { }
	}

	$conn = mysqlnd_uh_test\connect::mysqli();
	var_dump($conn->change_user(MYSQLND_UH_TEST_MYSQL_USER, MYSQLND_UH_TEST_MYSQL_PASSWD, MYSQLND_UH_TEST_MYSQL_DB));
	mysqlnd_uh_test\query_test::mysqli($conn);

	mysqlnd_uh_set_connection_proxy(new MySQLndUhConnection());
	var_dump($conn->change_user(MYSQLND_UH_TEST_MYSQL_USER, MYSQLND_UH_TEST_MYSQL_PASSWD, MYSQLND_UH_TEST_MYSQL_DB));
	mysqlnd_uh_test\query_test::mysqli($conn);

	mysqlnd_uh_set_connection_proxy(new proxy());
	var_dump($conn->change_user(MYSQLND_UH_TEST_MYSQL_USER, MYSQLND_UH_TEST_MYSQL_PASSWD, MYSQLND_UH_TEST_MYSQL_DB));
	mysqlnd_uh_test\query_test::mysqli($conn);

	mysqlnd_uh_set_connection_proxy(new proxy2());
	var_dump($conn->change_user(MYSQLND_UH_TEST_MYSQL_USER, MYSQLND_UH_TEST_MYSQL_PASSWD, MYSQLND_UH_TEST_MYSQL_DB));
	mysqlnd_uh_test\query_test::mysqli($conn);

	mysqlnd_uh_set_connection_proxy(new proxy3());
	var_dump($conn->change_user(MYSQLND_UH_TEST_MYSQL_USER, MYSQLND_UH_TEST_MYSQL_PASSWD, MYSQLND_UH_TEST_MYSQL_DB));
	mysqlnd_uh_test\query_test::mysqli($conn);

	mysqlnd_uh_set_connection_proxy(new proxy4());
	var_dump($conn->change_user(MYSQLND_UH_TEST_MYSQL_USER, MYSQLND_UH_TEST_MYSQL_PASSWD, MYSQLND_UH_TEST_MYSQL_DB));
	mysqlnd_uh_test\query_test::mysqli($conn);

	print "done!";
?>
--EXPECTF--
bool(true)
bool(true)
proxy::changeUser(array (
  0 => NULL,
  1 => '%s',
  2 => '%s',
  3 => '%s',
  4 => false,
))
bool(true)
bool(true)
bool(false)

Warning: mysqli::change_user(): (MySQLnd User Handler) The method MySQLndUhConnection::changeUser() did not return a boolean value as it should in %s on line %d
bool(true)

Warning: mysqli::change_user(): (MySQLnd User Handler) The method MySQLndUhConnection::changeUser() did not return a boolean value as it should in %s on line %d
bool(false)
done!
